package org.hako.recite.word.tool;

import java.util.HashSet;
import java.util.Set;

/**
 * Hiragana table.
 * 
 * @since 0.4.14
 * @author <a href="mailto:xnnyygn@gmail.com">xnnyygn</a>
 */
public class HiraganaTable {

	public static final String HIRAGANA = "あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわをんがぎぐげござじずぜぞだぢづでどばびぶべぼぱぴぷぺぽっゅょゃ";
	public static final String KATAKANA = "アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲンガギグゲゴザジズゼゾダヂヅデドバビブベボパぴぷぺぽッュョャ";
	private Set<Character> hiraganaSet;

	/**
	 * Create
	 */
	public HiraganaTable() {
		super();
		hiraganaSet = new HashSet<Character>();
		int hiraganaCount = HIRAGANA.length();
		for (int i = 0; i < hiraganaCount; i++) {
			hiraganaSet.add(new Character(HIRAGANA.charAt(i)));
		}
	}

	/**
	 * Check if table contains specified character.
	 * 
	 * @param c
	 * @return
	 */
	public boolean contains(Character c) {
		return hiraganaSet.contains(c);
	}

	/**
	 * Check if table contains specified character.
	 * 
	 * @param c
	 *            character want to check
	 * @return
	 */
	public boolean contains(char c) {
		return contains(new Character(c));
	}
}
